#include <stdlib.h>

int my_syscall(void) {
    asm (
            "movl %0, %%ecx\n\t"
            "movl $4, %%eax\n\t"
            "movl $1, %%ebx\n\t"
            "movl $8, %%edx\n\t"
            "int $0x80\n"
            :
            : "r" ("goodbye\n")
            //: /* no clobbered list */
        );
    
    return 0;
}
int main(int agrc, char **argv) {

    write(1, "hello\n", 6);
    //write(1, "goodbye\n", 8);
    
    // wont work when compiled in 32 bit mode because
    // NR_write in 32 bit is 4
    // syscall(1, 1, "goodbye\n", 8);

    // syscall(4, 1, "goodbye\n", 8);

    my_syscall();

    exit(0);
}
